Trigonometric funtions from "14,000 CIRCLES"

Charlie Veniot24th June 2022 at 9:28pm
' BASIC Anywhere Machine program by Charlie Veniot
' Trigonometric functions by Hamid Naderi Yeganeh for "14,000 CIRCLES" at https://blogs.scientificamerican.com/guest-blog/making-mathematical-art/

pi = 3.1415929
screen _newimage(2500, 2200, 21)
for k = 1 to 14000
x = int ( cos(10 * pi * k / 14000) * ( 1 - ( 1 / 2 ) * (cos(16 * pi * k / 14000))^2 ) * 1000 )
y = int ( sin(10 * pi * k / 14000) * ( 1 - ( 1 / 2 ) * (cos(16 * pi * k / 14000))^2 ) * 1000 )
r = int ( ( 1 / 200 + 1 / 10 * (sin(52 * pi * k / 14000))^4 ) * 1000 )
' print x, y, r
if r > 70 then
   c = &hfBf3E6 
elseif r < 70 and r > 10 then
   c = &hb8bc86 + (r mod 500)
else
   c = &hFFD700
end if
circle (x+1200,y+1100), r, c
next k